fixed Makefile
simplified code