Linear chains of nanomagnets: engineering the effective magnetic anisotropy.