I want to know why the relative pronoun, którym, is dative singular and not plural którymi. I get the impression that wiedzie się is an impersonal verb
You're getting your cases mixed up,
the instrumental
singular sing masc = którym
plural (all genders) = którymi
dative sing masc = któremu
dative plural (all genders) którym
You'll note that the dative plural adjective ending looks just like the instrumental singular adjective ending (for masc and neuter nouns).
nawet ci, którym wiedzie się w ojczyźnie całkiem nieźle - też myślą o emigracji.
let's try an idiomatic translation
Even those, for whom things are going well, are also thinking of emigrating.
here wiedzie się (komuś) means something like 'go well for someone' but Polish uses the dative case instead of a preoposition in this particular context.
Clear?
If it makes you feel better, this kind of confusion is not anything to worry about, it takes time and a _lot_ of exposure to automatically recognize (and keep straight!) the various endings.