Change -pthread to -lpthread