Lite-C looks for things in order they appear in the script, so it's looking for the PANEL* but it's defined later down in the script.

You can use a 'prototype' which makes the engine aware of a function or object but doesn't have to define it. It can be defined later on...
Code:
#include <acknex.h>
#include <default.c>

function begin_level(); // prototype

function main()
{
screen_size.x = 800;
screen_size.y = 600;
screen_color.blue = 150;
mouse_mode = 4;
}

PANEL* main_pan =
{
bmap = "Background.png";
pos_x = 0; 
pos_y = 0; 

button (518, 520, "Singleplayer2.png", "Singleplayer.png", "Singleplayer2.png", begin_level, NULL, NULL);
flags = OVERLAY | SHOW;
}

function begin_level()
{
level_load("ID.wmb");
reset(main_pan,SHOW);
}