remove -pthread flag on Darwin since it's not necessary and added on Linux