Update to get it compiling on HaikuR1/alpha4

Add makefile
Minor code changes