Improve 'prepare.py' script to generate smaller makefiles

The XXXX_OBJ_FILES target were improved to use the 'patsubst'
command from 'make'. Thus, we can replace the list of object
files by only one command.