Update to get it compiling on HaikuR1/alpha4

Added a makefile and made some minor code changes.

Compiles and runs in HaikuR1/alpha4 and HaikuR1/hrev46066. Doesn't look quite right; only drawing about a quarter of the screen and colours are screwed up. But that might be a feature of me running Haiku in Parallels.