Fixed some bugs in Makefile.sub.