Platform support

Change some extensions, ifdefs, and flags so that it should compile more
cleanly on linux.