generate makefiles script bug fix