fixed linking pthread