In The Lord of the Rings, the elves invented an incredibly nutritious bread/biscuit; as Legolas clearly says, only a small bite is just enough to satisfy the needs of an adult man for 1 day.
An adult person needs about 2000 kilocalories per day... maybe 1600-1700 for extremely skinny and underweight people, or those who have jobs that require no physical skills. But I'm going with the 2000 kilocalories one...
Each bite of lembas needs to sustain a person, so it might give 50 grams of protein, 250 grams of carbs, and enough fats to avoid protein toxicity - maybe 80-85 grams of fat can make it.
So how would a medieval society create lembas without magic? Putting and compacting extreme loads of nutrients together is easy, the hard part is to make it edible, and, most importantly, not deadly.
Feel free to adjust the fat-carbs-protein ratio as you prefer. but please keep it healthy and close to 2000 kilocalories per bite.
What it tastes like doesn't matter, after all is just a bite.