Update to get it compiling on HaikuR1/alpha4

Add makefile
Minor code changes
Merge pull request #1 from alistairmcmillan/master

Update to get it compiling on HaikuR1/alpha4