Linker did not have  libthread in options.