How can I attach wooden shelf ledgers to concrete foundation walls?
There are many types of concrete anchors available. Have you looked into them? Which you choose partly depends on the tools you have available. However, I'd consider freestanding shelves attached to the framing above.

Since your plan is to use lag screws already, why not use anchors designed to accommodate them? This way you can use the same screws throughout. 

Lag Shield



Expanding Anchor



Concrete Screws