Added -pthread to get compiling on linux