The ideal thing is to use a refractory mortar that is designed for the high temperatures of a wood stove or fireplace. You may also need to replace some of the refractory bricks. These are available at wood stove shops and can be cut to fit. The existing bricks can usually be removed fairly easily and measured. You need to map where the different size bricks go before removing them and take the measurements to a supplier. For refractory mortar see the web page at the link below for an example and online orders if you choose.