Below is the procedures to compile a linux kernel for ubuntu
1. get kernel source code
$ sudo apt-get install linux-source
$ cp /usr/src/linux-source-3.13.0.tar.bz2 ~/ubuntu
$ cd ~/ubuntu
$ tar jxvf linux-source-3.13.0.tar.bz2
2. compile kernel
$ cd linux-source-3.13.0
$ make menuconfig
$ make
3. install new kernel
$ make modules_install
$ make install
$ update-initramfs -c -k
5. make sure kernel is build correctly
$ sudo ls /boot/*
6. check current kernel versuib
$ uname -r
// The original version is The new version is linux-source-3.13.0
7. After reboot
$ uname -r
// The new version is linux-source-3.13.0