2.8.1 build failure, libpthread
Trying to build xmrig-nvidia 2.8.1 from source on Ubuntu 17.10 failed due to OpenSSL error in cmake phase. Please see below

System info:
```
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 17.10
Release:	17.10
Codename:	artful
$ uname -a
Linux orca2 4.13.0-21-generic #24-Ubuntu SMP Mon Dec 18 17:29:16 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ cmake --version
cmake version 3.9.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 7.2.0-8ubuntu3.2' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.2.0 (Ubuntu 7.2.0-8ubuntu3.2) 

```
Packages:
```
$ dpkg -l | grep libssl
ii  libssl1.0.0:amd64                          1.0.2g-1ubuntu13.3                          amd64        Secure Sockets Layer toolkit - shared libraries
$ dpkg -l | grep openssl
ii  libgnutls-openssl27:amd64                  3.5.8-6ubuntu3                              amd64        GNU TLS library - OpenSSL wrapper
ii  openssl                                    1.0.2g-1ubuntu13.3                          amd64        Secure Sockets Layer toolkit - cryptographic utility
ii  perl-openssl-defaults:amd64                3                                           amd64        version compatibility baseline for Perl OpenSSL packages
$ dpkg -l | grep libmicrohttpd
ii  libmicrohttpd-dev                          0.9.55-1                                    amd64   
```
Build command and the error:
```
$ cmake ..
-- The C compiler identification is GNU 7.2.0
-- The CXX compiler identification is GNU 7.2.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found UV: /usr/lib/x86_64-linux-gnu/libuv.a  
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda (found suitable version "9.2", minimum required is "7.5") 
-- Found NVML: /usr/local/cuda/include  
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR) 
CMake Error at cmake/OpenSSL.cmake:17 (message):
  OpenSSL NOT found: use `-DWITH_TLS=OFF` to build without TLS support
Call Stack (most recent call first):
  CMakeLists.txt:195 (include)


-- Configuring incomplete, errors occurred!
See also "/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeOutput.log".
See also "/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeError.log".

```

Looking in CMakeError.log, I see
```
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2cdad/fast"
/usr/bin/make -f CMakeFiles/cmTC_2cdad.dir/build.make CMakeFiles/cmTC_2cdad.dir/build
make[1]: Entering directory '/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2cdad.dir/CheckSymbolExists.c.o
/usr/bin/cc   -fPIC    -o CMakeFiles/cmTC_2cdad.dir/CheckSymbolExists.c.o   -c /home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_2cdad
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2cdad.dir/link.txt --verbose=1
/usr/bin/cc -fPIC     -rdynamic CMakeFiles/cmTC_2cdad.dir/CheckSymbolExists.c.o  -o cmTC_2cdad 
CMakeFiles/cmTC_2cdad.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x1b): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_2cdad.dir/build.make:97: recipe for target 'cmTC_2cdad' failed
make[1]: *** [cmTC_2cdad] Error 1
make[1]: Leaving directory '/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_2cdad/fast' failed
make: *** [cmTC_2cdad/fast] Error 2

File /home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
  (void)argv;
#ifndef pthread_create
  return ((int*)(&pthread_create))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_2b809/fast"
/usr/bin/make -f CMakeFiles/cmTC_2b809.dir/build.make CMakeFiles/cmTC_2b809.dir/build
make[1]: Entering directory '/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_2b809.dir/CheckFunctionExists.c.o
/usr/bin/cc   -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_2b809.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.9/Modules/CheckFunctionExists.c
Linking C executable cmTC_2b809
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_2b809.dir/link.txt --verbose=1
/usr/bin/cc -fPIC -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_2b809.dir/CheckFunctionExists.c.o  -o cmTC_2b809 -lpthreads 
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_2b809.dir/build.make:97: recipe for target 'cmTC_2b809' failed
make[1]: *** [cmTC_2b809] Error 1
make[1]: Leaving directory '/home/mahmood/xmrig-nvidia-2.8.1/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_2b809/fast' failed
make: *** [cmTC_2b809/fast] Error 2
```

However, libpthread exists in the systems

```
$ sudo find /usr/ -name libpthread*
/usr/lib/x86_64-linux-gnu/libpthread.so
/usr/lib/x86_64-linux-gnu/libpthread.a
/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
/usr/share/doc/libpthread-stubs0-dev
/usr/share/gdb/auto-load/lib/x86_64-linux-gnu/libpthread-2.26.so-gdb.py
$ sudo find /lib -name libpthread*
/lib/x86_64-linux-gnu/libpthread-2.26.so
/lib/x86_64-linux-gnu/libpthread.so.0
```
Any idea?