Only use $(Configuration) for MSVC_IDE builds.

Using `$(Configuration)`, which is only useful for msbuild/Visual Studio, breaks [ninja](http://martine.github.io/ninja/) builds. This is because `$` is an escape character. This PR replaces `$(Configuration)` with a macro whose value is `$(Configuration)` when using msbuild/Visual Studio, and `${CMAKE_BUILD_TYPE}` otherwise.