Tuning the magnetic anisotropy of lanthanides on a metal substrate by metal-organic coordination