The interstellar spectrum towards the supernova 1987A in the Large Magellanic Cloud