if ($u = $this->generateUrl('_'.$specific.'_thanks'))
Route "_specific_thanks" does not exist.
I don't think there's a direct way to check if a route exists. But you can look for route existence through the router service.
$router = $this->container->get('router');
You can then get a route collection and call
get() for a given route, which returns null if it doesn't exist.
$router->getRouteCollection()->get('_'. $specific. '_thanks');