Restore JSON layout support

Improve Makefile to rebuild layout.h when the layout or the generation
script are updated.