CUDA 9.1 uninstall causes "cannot locate kernel sources" error at reinstall

I used the run-file method to install nvidia drivers (without openGL) and cuda-toolkit on Ubuntu 16.04 and was able to compile and run the examples and tests without problems. Then I uninstalled using

$ sudo /usr/local/cuda-9.1/bin/
$ sudo /usr/bin/nvidia-uninstall

Now I’m trying to reinstall but get “cannot locate kernel sources” error. Any idea what may cause this problem? Kernel and gcc are not the recommended ones but did not cause problems initially.

$ uname -r 
$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609