Added -lpthread.