Correct issues with pthread linking on linux