Network backend: Allow to compile without pthreads

By passing -DHAVE_PTHREAD=0 to the CPPFLAGS, the network backend can now
be compiled without using the posix threads.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Makefile: Allow to compile without threads

By passing WITH_PTHREAD=no it is now possible to build a version of
libiio that doesn't use pthreads.

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>