Add Pthread dependencies to CMake

Add Pthread dependencies to CMake to enable compilation in Ubuntu.