build: fix llvm linking

Use llvm-config tool to get the needed LLVM libraries.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
build: fix clang linking

At least on linux with gcc the linking order of the libraries is
important. Fix linking clang libraries by changing the link order.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
build: remove unused StaticLinksOpt()

The function is not used anymore, so remove it.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>