Port the build system to AutoMake