Use --system-libs in llvm-configure instead of manual libs for -lpthread and -ldl