The engine of a 30-foot yacht carrying four people and a dog failed and triggered an emergency response from HM Coastguard as it drifted too close to cliffs.