An algorithm producing a standard spine of a 3-manifold presented by surgery along a link