Literally "to embrace the Buddha's feet." From the longer saying
平时不烧香,
临时抱佛脚 ("You don't burn incense on ordinary days, then cling to the Buddha's feet at the last minute") — i.e., you ignore the gods all year, then suddenly grovel when you need a favor. The image is of someone bursting into a temple in panic and clutching the statue's feet.