Compiling Programs for use with COMEDI

I had a question a few days ago about getting a runtime error from a COMEDI 
demo program I had compiled.  It turned out that I had better luck by using 
the Makefile provided (i.e. 'make tut1'), despite the documentation saying 
that I could just use gcc tut1.c -I../include -lcomedi -o tut1.

I am now trying to compile another file of my own creation, but the 
Makefile in the /demo directory is insanely convoluted.  Could someone 
please tell me what the typical library paths and compiler switches 
are?  Surely compiling and executing a simple program cannot be so hard in 
the Linux world!

Thanks,
-Jagan
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.536 / Virus Database: 331 - Release Date: 03/11/2003

Received on 2003-11-05Z19:00:24