Fix bugs in Makefiles.