Preheat oven to 350°F (175°C). Grease a 9x13-inch baking dish.
Crinkle phyllo sheets: Take 2-3 sheets at a time, loosely fold into an accordion shape, and place in the baking dish. Repeat until all phyllo is used.
Bake phyllo for 10 minutes. Remove from oven and drizzle with half the melted butter. Bake for another 5-7 minutes until lightly golden.
Make custard: Whisk together milk, eggs, sugar, vanilla, and almond extract (if using).
Pour custard over partially baked phyllo. Drizzle remaining butter on top.
Bake for 35-40 minutes, until custard is set and top is golden brown.
While cake bakes, make syrup: Combine sugar, water, and lemon juice in a saucepan. Bring to a boil, then simmer for 10 minutes until slightly thickened.
Pour hot syrup over the baked cake immediately after it comes out of the oven.
Allow cake to cool to room temperature before serving.