fixed compiling errors, add makefile