They were definitely synonyms and *were* interchangeable to a large degree. According to various dictionaries that Pleco references in its entry to「闕」:

 - *Pleco Chinese-English* (PLC): `Variant of 缺`

 - *CC-CEDICT* (CC): `Used in place of 缺 (old)`

 - *Cross-Straits* (LAC): `脫漏。通「缺」。`

 - *MOEDict* (MOE): `脫漏的。闕字有二音,音ㄑㄩㄝ時義同「缺」。但使用習慣上仍見分別,如「拾遺補闕」、「疑闕」、「闕文」專詞多作「闕」,少用「缺」。`

The last definition describes the modern usage differences between the two.


 Note that *to lack* is unlikely to be the original meaning of either「闕」or「缺」:

 - 闕, 門觀也。从門,欮聲。〔去月切〕(Basically,「闕」is a watchtower on a city wall; this is the Shuowen definition and AFAIK there's no evidence contradicting this.)
 - [「缺」:從「缶」,「夬」聲。本義是器物破損。〔傾雪切〕](http://humanum.arts.cuhk.edu.hk/Lexis/lexi-mf/search.php?word=%E7%BC%BA)

*To lack* could be interpreted as an extension of the original meaning of「缺」, and sometimes authors used「闕」for this meaning instead as a phonetic loan. Later on, the usage of「闕」and「缺」somewhat became differentiated.