The Giants and ace Tim Lincecum have reached a two-year, $40.5 million deal, avoiding arbitration.The deal also buys out the right-hander's final two years of arbitration eligibility.