Pr configure fixes for visual studio

Various fixes to make cmake to pass successfully on with -G "Visual Studio 12" generator. Also fixed one test case linking problem with poclu when compiling on Ubuntu with self compiled llvm 3.5.