In "many good ways", it is the *ways* that are good.
In "a good many ways", it is the *many* that is good. To justify this grammatically requires A Great Muchness of effort. Nonetheless, I will try. I interpret "good" as an adjective that modifies the noun "many", as in the sentence "I have a good many". I interpret "ways" as a sort of dative case, as in Old English, so that "ways" really means "of ways". To be strictly correct, you would write "a good many of ways".
Where I live, "a good many" is a common expression used in the same ways that "many" is used:
"I have many"; "I have a good many"
"There are many ways"; "There are a good many ways"
I have a question: Why can't we say "a good (or great) much"? For instance,
"We ate a good much of (the) food"
sounds bad (at least to me). However, if we change it just a little bit, it sounds OK:
"We ate a little much of the food"
sounds good to me. I can think of no explanation for this asymmetry.