IIRC there are provisions in the NLRA that address situations like this. If Amazon primarily directs the activities of the workers, not the contractor company, if Amazon can dismiss individual employees then they're consider a kind of joint employer and can still be unionized against.