Cook lentils in vegetable broth. While the lentils cook (about 15 minutes), chop onion, carrots, celery, and mushrooms into small dice. Chop walnuts finely. Add avocado oil to a pan on medium heat and saute onions, carrots, and celery until slightly soft. Add mushrooms and cook for another 5 minutes. Add tomato paste, balsamic vinegar, coconut aminos, and seasonings to the vegetable mixture. Warm through. Add half of the cooked lentils to a large bowl. Mash the lentils with a fork to form a thick paste-like texture. Add the remaining lentils, cooked vegetables, chopped walnuts, and flax meal into the bowl. Stir until completely combined. Line a loaf pan with parchment or use a silicone loaf pan. Add the loaf mixture to the loaf pan and pack down the mixture to form a loaf. Add ketchup or BBQ sauce to the top of the loaf. Bake at 400°F for 40-45 minutes. Let cool before removing from the pan, and slice to serve!