Fixed issue with finding libjpeg outside the search path,
removed libpthread, since c++11 threads are used.