Fix some Makefile bugs