British manufacturing rebounded in August as factories recovered from the initial shock of June's vote to leave the European Union.