So precise a measurement of the year, of course, would have been irrelevant to an early farmer, even if the astronomers could have measured it. A shift of five or ten days won't really matter too much, since annual variations in the weather will be greater than that. Once the calendar is out by a month or more, however, problems will arise if the farmer depends upon the calendar. It doesn't necessarily follow, however, that an agricultural society needs to keep its calendar tied, even loosely, to the seasons. Even if we assume that farmers really need someone to tell them when spring is coming, an alternate procedure would be for a specialist, for example a calendar priest, to announce when the proper planting time fell in the calendar.
Lunar cycles were the most common basis for early calendars. These calendars were often not based on any mathematical determination of the synodic month at all, but relied, particularly in their earliest formulations, upon direct observation to determine the new month. So when do you define the month as beginning? The two obvious starting points are the new or the full moon. Since the astronomical new moon occurs appears so close to the sun as to be invisible, this gives us three observational possibilities: the full moon, the first crescent of the ascending moon after the new moon, visible at sunset, or the last crescent of the descending moon, visible just before sunrise. There is a correlation between when the next day is considered to begin and which observational choice is made. For a society that begins the new day at dawn, the first day the waning moon is invisible just before sunrise is a good time to start the new month. If the next day begins at sunset, e.g., the Jewish Sabbath, the first observation of the new moon makes more sense. A full moon observation would seem to imply a midnight start. Such observations can be used in either a lunar or a lunisolar calendar. It will result in months that generally alternate between 29 and 30 days, but because the synodic month is not exactly 29.5 days, the alternation will not be completely regular.
Direct observation does have its drawbacks. Clouds might obscure observation, and in a large civilization, there is a problem with ensuring each location stays in sync with the rest. The historical development of lunar and lunisolar calendars is largely a matter of replacing direct observation by mathematical formulas and tables that allow the prediction of the month's start without the need for observation.
Lunisolar calendars have the additional problem of keeping the lunar months roughly aligned with the solar year. They generally do this by the insertion of a 13th, intercalary month at periodic intervals. Once again, in a calendar's earliest stages, this intercalation was generally accomplished through decree from a central source. In later times, regular rules were developed.
Obviously some of your decisions will be based on just how precise your measurements have been, but even more on the needs of your society (and your patron, who is footing the bill, after all). You will need to account for any preexisting traditions. If your people have been counting seven-day cycles for hundreds of years, resting on the seventh day, they will probably not accept a change to a ten-day cycle, which is what was attempted in revolutionary France. Religious aspects and cultural conservatism aside, neither inconsequential, this change would mean fewer days of rest for people. You also might want to consider your own needs. A complex calendar that is constantly changing with respect to the solar year, for instance, might seem like a bad choice. But if you can get this calendar accepted, you are guaranteed lifetime employment (i.e., tenure). After all, someone has to interpret this thing to tell people when to plant each year, when to celebrate the religious festivals, etc.
Once we've decided on what cycles, we have to decide how to count them. Do we cycle through a small number of names (e.g., our months)? Do we make a fixed numerical count of cycles from some predetermined epoch (e.g., our years)?
Since most calendars have been either solar (based on the tropical year), lunar (based on the synodic month), or lunisolar (a combination of the two), let's look at the problems we face making these cycles mesh.
Assume we take the day as the basic period (we don't have to, but it makes sense, since it's the light/dark rhythms that people base their activities upon). This means we need to fit the year and/or month cycles into some whole number scheme that approximates the observed values. As an approximation, we could round off the tropical year to 365.25 days and the synodic month to 29.5 days. These fractional days we can represent fairly easily, for the year by intercalating (inserting) one day every four years and for the months by making our lunar months alternate between 29 and 30 days.
With these approximations, we are only off the true period of the tropical year by about 1 day every 128.5 years, but with the lunar cycle it takes less than 3 years to slip a day (hence we?ll need to add some leap days here as well). Moreover, whether we use the true values or their approximations, there is no obvious way to get a whole number of lunar cycles into a whole number of solar cycles (in case we want a lunisolar calendar). The nearest rough approximation, and one that seems to have been a common early choice, is 365 days and 12 1/3 lunar cycles (also 365 days if we alternate 29 and 30 day months) per solar cycle.
A much better approximation, and one that we will see cropping up repeatedly, is the Metonic cycle, which observes that 19 tropical years are equal to 235 synodic months. Plugging in the actual lengths year and month to these numbers, we find 19 years = 6939.6018 days 235 months = 6939.68865 days which means this approximation has an error of only about 1 day every 219 years. This error value will change somewhat, of course, when we use the 19:235 ratio in a civil calendar, which contains its own approximations to the year length (see below, particularly the Julian calendar).
These considerations should also make it clear that just because a calendar doesn't match up to the solar or lunar cycles exactly doesn't necessarily imply that astronomers in that culture didn't have a much better idea of what the true values were. In fact, there's direct evidence to the contrary. A calendar must balance accuracy against simplicity, and once a calendar is well established in a society, changing it can be very difficult.