Update cmake files: need to statically link to libpthreads.a in order to avoid a 'winpthreads-1.dll missing' error.