Its not a GPS issue actually. Go to Settings > Additional setting > Battery & Performance > Manage apps battery usage > Choose apps, find Endomondo app and choose them. Put Background settings to No restrictions and Background location to Allow. All should work fine.