Changed some flags, fixed important bug, now compiles on linux with gcc -v 4.8.2