Added -pthread to linking