Mhath is used with feminine nouns (all nouns in Gaelic have a gender, like in French, if that helps). Conversely, math is used with masculine nouns. In this case, the adjective "math" has been transformed into an adverb by adding the "gu" beforehand (making it into good-ly as rough/literal translation). I’ve not seen "gu mhath" before, only "gu math" used. But I'm happy to be corrected on that.