Update CMake file to link with threads library

Ubuntu 14.10 requires linking with pthread