At the top level (the directory this file is in), run

    make clean all

This will configure all the sub-directories correctly. Subsequently, you may run
make from the individual directories.

If any configuration changes (e.g., if you need to re-run any configure
scripts), or there are cross-directory changes, you will have to re-run the
above command from the top-level.