A British law firm has struck a £2bn deal to merge with a US rival that was targeted by Donald Trump earlier this year.