Local spectrum of a superconductor as a probe of interactions between magnetic impurities