You don't have to live in a country to be hired as a contractor by a company. The only difference is that the contractor will pay taxes in the country of residence, so ultimately it's a bad deal for the US.