Add makefile and fix the build