Added Makefile and fixed last bugs