ERROR: Kernel Makefile (/usr/src/linux/Makefile) missing

This is a wiki page. Be bold and improve it!

If you have any questions about the content on this page, don't hesitate to open a new ticket and we'll do our best to assist you.

Error

# genkernel --splash --no-install --no-clean --menuconfig all
* Gentoo Linux Genkernel; Version 3.4.52.4
* Running with options: --splash --no-install --no-clean --menuconfig all

* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..

* ERROR: Kernel Makefile (/usr/src/linux/Makefile) missing.  Maybe re-install the kernel sources.
*
* -- Grepping log... --
*
* Running with options: --splash --no-install --no-clean --menuconfig all
* Using genkernel.conf from /etc/genkernel.conf
* Sourcing arch-specific config.sh from /usr/share/genkernel/arch/x86_64/config.sh ..
* Sourcing arch-specific modules_load from /usr/share/genkernel/arch/x86_64/modules_load ..
*
* ERROR: Kernel Makefile (/usr/src/linux/Makefile) missing.  Maybe re-install the kernel sources.
*
* -- End log... --
*
* Please consult /var/log/genkernel.log for more information and any
* errors that were reported above.
*
* Report any genkernel bugs to bugs.gentoo.org and
* assign your bug to genkernel@gentoo.org. Please include
* as much information as you can in your bug report; attaching
* /var/log/genkernel.log so that your issue can be dealt with effectively.
*
* Please do *not* report compilation failures as genkernel bugs!
*

Solution

Make sure to install kernel sources:

root # emerge --ask sys-kernel/gentoo-sources

If the sources are already installed, make sure you have selected a valid kernel:

root # eselect kernel list
Available kernel symlink targets:
  [1]   linux-4.4.6-gentoo
  [2]   linux-4.4.21-gentoo

The absence of a star above indicates that no kernel is currently selected.
Do so now:

root #  eselect kernel set 2
root # eselect kernel list
Available kernel symlink targets:
  [1]   linux-4.4.6-gentoo
  [2]   linux-4.4.21-gentoo *

linux-4.4.21-gentoo is now selected.