With the parameter --toolchain valgrind-massif, the configure script sets reasonable defaults that can be overridden as explained in the documentation.