Port the changes from 4.1-dev that avoid it failing on automake 1.12.2. I'm not sure why it doesn't cause a failure here too, but it is a useful cleanup anyway.