Fix -pthread in a different way