tools/llvm-config: improve shared library support