When I get a lack of sleep (…), I often have a splitting headache the next day
This connection is typical for migraine.
Also, many people sleep with a too thick pillow, and this could also cause headaches because of tensions. Try a thin one, or only a little towel instead of a pillow.