change -lpthread to -pthread