Fixes Mac OSX 10.9 with libc++

Only switches to libstdc++ when you actually have CUDA and you enabled it.
Merge pull request #487 from fran6co/patch-7

Fixes Mac OSX 10.9 with libc++