It's been a while now since I've made my own custom build of tomato. Typically I would use Toastman's source code tree and make a few changes. I posted some instructions back in 2012 on how to successfully build Toastman's source code tree. I suggested using ubuntu 11.04 virtual machine as the build environment. I'm attaching my old build instructions.
Can...
tomato build environment
Can...
tomato build environment