Here I describe how I built the getfem_toolbox. This description is based on the original readme. I hope it is helpful. Feel free to correct this description!
$HOME/getfem++-3.1/./configure --enable-matlab=yes --with-getfem-config=$HOME/getfem++-3.1/getfem-config-notinstalled \ --with-toolbox-dir=$HOME/getfem_toolbox make
export PATH=/c/Program\ Files/MATLAB/R2007b/bin:$PATH
cd getfem++-3.1/interface/src/matlab "c:/Progra~1/MATLAB704/bin/win32/mex.bat" -v -f c:/path/to/mexopts.bat ^ -output gf_matlab -g -D"MATLAB_RELEASE=14" ./gfm_mex.c ./gfm_common.c ^ -I. -I.. ./../gfi_array.c ../.libs/libgetfemint.a ^ C:/msys/1.0/home/<YOUR_MSYS_USER>/getfem++-2.0/src/.libs/libgetfem.a ^ c:/MinGW/lib/libstdc++.a
cd getfem++-3.1/interface/src/matlab mex -v -output gf_matlab -g -D"MATLAB_RELEASE=14" ./gfm_mex.c ./gfm_common.c -I. -I.. ./../gfi_array.c ../.libs/libgetfemint.a C:/msys/1.0/home/<YOUR_USERNAME>/getfem++-3.1/src/.libs/libgetfem.a c:/MinGW/lib/libstdc++.a
When using the graphical interface of matlab, a number of intermediate messages of getfem get lost (for example those displaying the progression of iterative solvers). You may want to launch matlab from the msys shell instead of launching it from its shortcut. In that case, those intermediate messages from getfem will be displayed in the msys window.