fix bugs in Makefile