As strange as this may seem, the github version compiles almost from the box. The required build system works straight, without any problems, using python3.6. The 'ninja -C build' link phase fails with missing references to the l(for long) versions of some 6-7 floating point functions, which I just took away from the math.c module. It appears we have all these functions, but not the l variants.
I guess the best would be to completely rework the package making use of the latest version. I've tried on numerous occasions to compile ast-ksh with the same result ( I tried to figure out what was going on, but the 'iffe' script was beyond my reckoning... ).