quick and dirty linux compilation

added THREADS flag to easily disable threading stuff
added linux.h as lightweight winapi compatibility layer