fix compiler warnings and add Makefile