Build fixes

There are two build fixes here: one for LLVM-3.1 (which I think doesn't define some things that later versions do), and the other is for the case where LLVMCore isn't installed. Many packages don't do this, for example Fedora only includes LLVM-version.so.

My fix for the later issue is to also check LLVM-version for the required function. I'm not sure of a better way.