Lions pull out first victory after wasting double-digit lead to Vikings