Makefile created and fixed some bugs