build script: Support ninja builds for cmake/make builds (-G Ninja)