Moar bug fixes

And Makefile should work on linux