change -lpthread to -pthread in linking

Compilation flags is already there