Fixed compile/linking bug by switching -lpthread to -pthread