updated Makefile
fixed bugs