<PAGE>   1
                                                                   Exhibit 10.5b

Manufacturers and Traders Trust Company
One Fountain Plaza, Buffalo, NY 14203-1495
(716) 842-4200 Fax: (716) 848-7318

Western New York Commercial Banking Department

                           SECOND AMENDMENT AGREEMENT


         This Agreement is executed the 9th day of May, 1997 as of March 14,
1997 between Manufacturers and Traders Trust Company, a New York banking
corporation having its chief executive office at One M&T Plaza, Buffalo, New
York 14240, (the "Bank"), and Comptek Federal Systems, Inc., a New York business
corporation having its chief executive office at 2732 Transit Road, Buffalo, New
York 14224, (the "Borrower").


         WHEREAS, the Bank and the Borrower previously entered into a Corporate
Revolving and Term Loan Agreement dated March 7, 1996, (as heretofore amended
the "Loan Agreement"); and


         WHEREAS, the Bank and the Borrower now desire to amend certain
provisions of the Loan Agreement;


         NOW, THEREFORE, effective as of the date of this Amendment Agreement,
the Bank and the Borrower agree that:


         1. Section 1c of the Loan Agreement is amended to read as follows:

         c. APPLICABLE MARGIN. "Applicable Margin" means for any day (i) if the
         total of (A) the aggregate outstanding principal amounts of all
         Revolving Loans at the end of such day and (B) the outstanding
         principal amount of Term Loan I at the end of such 



<PAGE>   2

                                      -2-



         day does not exceed $10,000,000, (I) 0% for purposes of clause (i) (A)
         of the first sentence of Section 2e of this Agreement and (II) 2% for
         purposes of clause (i) (B) (I) (1) of such sentence or (ii) if such
         total exceeds $10,000,000, (I) 1/2% for purposes of such clause (i) (A)
         and (II) 3 1/2% for purposes of such clause (i) (B) (I) (1).


         2. The Loan Agreement is changed by this Amendment Agreement only to
the extent that it is specifically amended by this Amendment Agreement, and, as
so amended, the Loan Agreement shall remain in full force and effect. Effective
as of the date of this Amendment Agreement, references in the Loan Agreement to
"this Agreement" shall be deemed to be references to the Loan Agreement as
amended by this Amendment Agreement.



         IN WITNESS WHEREOF, the Bank and the Borrower have caused this
Amendment Agreement to be duly executed on the date shown at the beginning of
this Amendment Agreement.



                         MANUFACTURERS AND TRADERS TRUST COMPANY

                         By /s/ Mark E. Hoffman
                           ---------------------------------------
                           Mark E. Hoffman, Vice President


                         COMPTEK FEDERAL SYSTEMS, INC

                         By /s/ John J. Sciuto
                           ---------------------------------------
                           John J. Sciuto, President and CEO


<PAGE>   3


                                      -3-




                                ACKNOWLEDGMENTS

STATE OF NEW YORK       )
                        :  SS.
COUNTY OF ERIE          )


        On the 9th day of May in the year 1997, before me personally came Mark
E. Hoffman, to me known, who, being by me duly sworn, did depose and say that he
resides at 120 Dorset Drive Buffalo, NY 14223; that he is a Vice President of
Manufacturers and Traders Trust Company, the corporation described in and which
executed the above instrument; and that he signed his name thereto by order of
the board of directors of said corporation.


                                        /s/ Christopher A. Head
                                     --------------------------------
                                             Notary Public

                                        CHRISTOPHER A. HEAD
                                        Notary Public, State of New York
                                        Qualified In Erie County
                                        My Commission Expires June 7, 1998

<PAGE>   4

                                      -4-

STATE OF NEW YORK       )
                        :  SS.
COUNTY OF ERIE          )


        On the 9th day of May in the year 1997, before me personally came John
J. Sciuto, to me known, who, being by me duly sworn, did depose and say that he
resides at 6392 Black Walnut Court, East Amherst, New York 14051; that he is the
President and CEO of Comptek Federal Systems, Inc., the corporation described in
and which executed the above instrument; and that he signed his name thereto by
order of the board of directors of said corporation.


                                        /s/ Christopher A. Head
                                     --------------------------------
                                             Notary Public

                                        CHRISTOPHER A. HEAD
                                        Notary Public, State of New York
                                        Qualified In Erie County
                                        My Commission Expires June 7, 1998