Replace custom build system with Automake build system.