fix pthread linkage