fixed makefile, other bugs