added compiler option -lpthread