Merck has struck a deal worth up to $1.3 billion to buy an investigational drug targeting B-cell associated diseases.