Added -lpthread. It seems it is needed in 13.10