Fix build with automake-1.13 and modernize .am files.