How To Recompile Your Linux Kernel
First, make sure you have installed the Linux kernel source for the kernel version you want to compile, and the latest version of GCC.
Type the following commands, in order:
cd /usr/src/linux make config make dep make zImage cp /usr/src/linux/arch/i386/boot/zImage /vmlinuz
NOTE: "make config" is the classic command to configure the kernel before compiling it. However, this command gives you an absolutely HUGE list of questions which must be answered sequentially; If you miss a question, you can't go back and change it. As a result, another option is provided with newer kernel versions which is much friendlier, and recommended for both novice and experienced users: Use "make menuconfig" instead, which will give you a nice menu-based configuration interface.
If you use LILO to boot Linux, after you have done all this you MUST type "lilo" at the command prompt to reconfigure LILO for the new kernel. Then reboot, and your new kernel should be functional.