The current FindZ3.cmake does not properly detect Z3 when it is built as a static library. This patch allows a Z3 static library to be used with LLVM.
The changes are:
- Build the Z3 version detection code as C++, since the static library brings in libstdc++ symbols
- Detect threading support and link against threading, in the (likely) case Z3 was built with threads