g++ 4.8 must have -pthread at the end