Please allow me to chip in my $0.02 and suggest to not reinvent the
wheel, but instead consider to migrate the build system to cmake :
http://www.cmake.org/
I agree that menu-wise, CMake does a pretty good job with ccmake, and is
much, much easier to create than autoconf/automake/m4 stuff (I speak
from experience).
However, for the command-line arguments, I find cmake non-intuitive and
pretty cumbersome. As example, to say
--with-tm=/usr/local/torque
with CMAKE, you would have to do something like
-DWITH_TM:STRING=/usr/local/torque
Maxime