[safestack] use -pthread instead of -lpthread