[Autotools] Fix for automake >= 1.12 + plot script bug fix