Fix Makefile bugs