to synchronize targets, you have 2 options. you can either create a single macro (/assist joe) and hit it after you select a new target or...

you use /focus joe and a macro for every target oriented spell that would use joe's current target. ie:

/cast [target=focustarget] fireball

you would also want to set a /follow macro. you have 2 options:

/follow joe

or

/follow focus

i believe using focus is the currently preferred mechanism as it would also allow you to easily transition to a new leader if your main dies. so, you would have a series of macros set.

here are some examples using 3 characters (joe: mage, same: mage, bob: priest):

joe:
--
ctrl+1 /clear focus
ctrl+2 /focus sam
ctrl+3 /focus bob
ctrl+= /follow focus
3 /cast [target=focustarget] fireball
sam:
--
ctrl+1 /focus joe
ctrl+2 /clear focus
ctrl+3 /focus bob
3 /cast [target=focustarget] fireball
ctrl+= /follow focus

bob:
--
ctrl+1 /focus joe
ctrl+2 /focus sam
ctrl+3 /clear focus
3 /cast [target=focustarget] fireball
ctrl+= /follow focus
alt+1 /cast [target=joe] heal
alt+2 /cast [target=sam] heal
alt+3 /cast [target=bob] heal
alt+- /cast [target=focus] heal
alt+= /cast [target=focustarget] heal
alt+q /cast [target=joe] shield
alt+w /cast [target=sam] shield
alt+e /cast [target=bob] shield
alt+- /cast [target=focus] shield
alt+= /cast [target=focustarget] shield