CMakeLib: Link to system thread libraries to support std::thread
Some environments require linking to thread libraries for std::thread
.
Express this direct dependency of CMakeLib explicitly. Previously this
was done indirectly through our bundled libuv, but that does not work
when using a system libuv.
Fixes: #17757 (closed)