Legal fees soar to £38.9m after busy half-year for public M&A