Adding -lpthread linking flag.