Added a makefile and fixed code so that this would compile on Linux