Fix llvm < 3.3 configure script

Configure was broken for llvm < 3.3; the AC program
needed some shell escapes.
Improved configure checks for llvm version
More robustness against NULL pointers