adding makefile and changes to compile on macos