apt-get source linux-source
It will download a TAR archive into your working directory. Untar the archive and cd into the directory with the kernel source.
Re/Configure the kernel by issuing:
It will ask you to reconfigure all kernel flavours in turn. Reconfigure the flavour you want to alter, not changing the others.
In order to build your kernel (the generic flavour) issue:
CONCURRENCY_LEVEL=2 AUTOBUILD=1 NOEXTRAS=1 skipabi=true skipmodule=true debian/rules binary-generic
After a while you should see deb packages in the parent directory.
If you want to come up with your flavour take a look at: http://mmlinux.wordpress.com/2009/07/30/how-to-compile-kernel-in-karmic/