He probably thanked Allah secretly.
I doubt Obama is a Moslem, rather I think that he’s a secular humanist, at least first and foremost. His real Holy Trinity can be best summed up as “Me, Myself, and I”.
He probably thanked himself.