Lincecum overcomes 5 extra-base hits as Giants win