create Makefile, fix some warnings