I had one of those years ago. It lasted days and wouldn't go away. I went to the hospital (embarrassed with explanation) but a Doctor told me to lay flat and he injected me with a powerful muscle relaxant. After about 5 mins, the pain went and never returned. He said a tiny muscle at the bottom of the skull was constantly in spasm, squashing nerves. The pain was severe, never had a headache like it before, or since. The pain made me nauseous and certainly got my heart racing.
According to Wikipedia, one of the causes of thunderclap headache is a condition called primary sexual headache. I think you need a doctor's help, probably a neurologist, to sort this out. The palpitations may be secondary to the headache and, if so, probably not indicative of a heart problem. But you need medical help. Some of the other causes of thunderclap headache involve serious brain pathology. Only a medical doctor is going to be able to help you with the diagnosis.