If I build a dark elixir storage before collecting my war loot, will I get the dark elixir I won, or is it already lost since I didn't have storage before war?
If you do not have a Dark Elixir storage, collecting your war loot bonus will discard all the Dark Elixir you've gained.
However, yes - Building a Dark Elixir storage prior to collecting the war loot and then collecting after your Dark Elixir storage is completed, will give you the Dark Elixir, without losing anything...
Since Clan Castles can store Dark Elixir since level 1, you can save up^ your war loot until you can get a Dark Elixir storage. Otherwise - There is no way to get the resources without losing the Dark Elixir.
^This is very hard if you're constantly fighting (and winning) war battles that is close to your current level, as the Clan Castle is balanced to always store enough loot to keep the winnings of 2 people from your level.