Fix #1540 no CUDA-capable device is detected

If CUDA libraries are not installed in `path/to/nvcc/../lib`,
there will be used incorrect -rpath, that will lead to the very
confusing error `no CUDA-capable device is detected`.

#1540