Added gcc -pthread flag