Add Makefile, corrected code