Add -pthread flag for building on linux