She somehow managed to make dinner herself.

Literal

She [topic-は] somehow self [by-で] dinner [object-を] make [the act-こと] [subject-が] could-do.

自分で ('by oneself, on one's own') here uses で in its instrumental/means sense — 'by means of oneself.' Contrast with 自分が, which would emphasise 'oneself (and not someone else)' as the agent. ことができた ('was able to') nominalises 作る ('make') with こと, then predicates with できる in past form. The combination of なんとか + ことができた gives 'somehow managed to' — there was effort or struggle involved, which fits dinner-making for someone presumably not used to it.