fixed link order around -pthread