Add makefile, some fixes