Although brick walls in a basement are indoors by definition, they are still exposed to some of the same kinds of weathering effects that cause exterior masonry to decay. Basements often have a cool, damp environment, and that kind of environment promotes the penetration of the mortar by moisture. You need to repair this mortar in a process called repointing. However, working on a basement wall can be more complicated than a standard repointing job.
Scrub away loose, crumbling mortar with a wire brush. Strike cracked mortar or any solid remnants stuck on the sides of the brick with a chisel, using medium taps from the hammer.
Make a batch of mortar in a bucket by adding water in the proportions indicated by the manufacturer, and pour it into a masonry bag. Mix up enough for between 15 and 30 minutes worth of repointing so that the mortar does not harden and clog the bag while you work.
Put the masonry bag spout into the empty wall joints -- the spaces between the bricks. Push mortar into these hollow spaces by holding the bag above its snout and squeezing. Fill up the joints to a level matching the old mortar.
Mold the fresh mortar with the trowel so its surface matches that of the old mortar. Scrape away excess mortar, and either drop it into the masonry bag for reuse or discard it.
Allow the repointed mortar to cure for at least 24 hours.
Coat the entire basement wall with a fresh coat of masonry sealant. If you intend to leave the basement with an exposed brick look, use clear sealant. If you intend to eventually paint the wall, use a white sealant that can double as primer.
Exercise care when chiselling at the back of the wall joints. The brick wall might be only a facade, with a breeze block foundation behind it. If the brick is part of the foundation, a second layer of brick is probably behind the facing wall. Either way, you need to avoid damaging whatever is behind the first layer of brick you are repointing.
If your house predates World War II, use a lime-and-sand-based mortar mix. Modern mortar is too hard to use with old-fashioned bricks. It does not allow the brick to expand and contract with changes in temperature, resulting in cracked and spalled bricks.