Glamorgan made to work harder for their rewards but still comfortably on top after day three