This is the 5048th most frequent Russian word.
месяцами
"Месяцами" means "for months."
Here, 'месяцами' is used adverbially to describe the duration of the action.
Он ждал её письма месяцами.
He waited for her letter for months.
In this sentence, 'месяцами' expresses the extended time frame dedicated to the preparation.
Она месяцами готовилась к экзамену.
She prepared for the exam for months.
'Месяцами' emphasizes the long period during which the action mentioned ('не видели' - 'hadn't seen') occurred.