Completed Makefile and correct some errors